home *** CD-ROM | disk | FTP | other *** search
- ;Programm: BangerMonitorID gibt bei der angewählten Auflösung die ID-Nummer aus
- ; Autor: Andre´ Trettin
- ;Codename: Banger
- ; Begin: 13-Dez-95 20:27:34
- ; $VER: BangerMonitorID.asm 1.3 (20-Dez-95)
-
- ** INCLUDE Struktur Variablen
- * Fehler Codes: 21=kein Speicher
- * 22=konnte Library (oder Libraries) nicht öffnen
- * 23=konnte Fenster nicht öffnen
- * 24=kein Speicher für ScreenModeRequester
- * 25=kein PubScreen vorhanden (Wo ist die Workbench)
-
- incdir INCLUDE:
- include exec/exec.i
- include exec/io.i
- include dos/dos.i
- include dos/dosextens.i
- include intuition/intuition.i
- include utility/utility.i
- include libraries/asl.i
- include lvo/exec_lib.i
- include lvo/intuition_lib.i
- include lvo/asl_lib.i
- include lvo/graphics_lib.i
- include lvo/utility_lib.i
-
- STRUCTURE Internal,0
- APTR INTUIBase
- APTR GFXBase
- APTR ASLBase
- APTR UTILBase
- APTR MyScreenReq
- APTR WindowHandle
- APTR ScreenHandle
- APTR WBenchMsg
- STRUCT EndeReqTxt,[64]
- LABEL Int_SIZEOF
- ;;
- ** Hauptprog
- moveq #0,d7
- move.l 4.w,a6
- move.l #Int_SIZEOF,d0
- move.l #MEMF_PUBLIC!MEMF_CLEAR,d1
- jsr _LVOAllocMem(a6)
- move.l d0,a5
- bne.s WorkBench
- moveq #21,d7 ;21 = kein Speicher
- bra.s Ende
- WorkBench
- suba.l a1,a1
- jsr _LVOFindTask(a6)
- move.l d0,a4
- tst.l pr_CLI(a4)
- bne.s fromCLI
- lea pr_MsgPort(a4),a0
- jsr _LVOWaitPort(a6)
- lea pr_MsgPort(a4),a0
- jsr _LVOGetMsg(a6)
- move.l d0,WBenchMsg(a5)
- fromCLI
- bsr.w LibOeffne
- tst.b d7
- bne.s SchliesseLibrary
- bsr.w PubScreenHolen
- tst.b d7
- bne.s SchliesseLibrary
- bsr.w OeffneFenster
- tst.b d7
- bne.s PubScreenSchliesse
- bsr.s ASLScreenAsk
- bsr.w FensterSchliesse
- PubScreenSchliesse
- bsr.w PubScreenAbgeben
- SchliesseLibrary
- bsr.w LibSchliesse
- tst.l WBenchMsg(a5)
- beq.s NOWBench
- move.l 4.w,a6
- jsr _LVOForbid(a6)
- move.l WBenchMsg(a5),a1
- jsr _LVOReplyMsg(a6)
- jsr _LVOPermit(a6)
- NOWBench
- move.l a5,a1
- move.l #Int_SIZEOF,d0
- jsr _LVOFreeMem(a6)
- Ende
- move.l d7,d0
- rts
- ;;
- ** ASLScreenAsk
- ASLScreenAsk
- move.l ASLBase(a5),a6
- moveq #ASL_ScreenModeRequest,d0
- suba.l a0,a0
- jsr _LVOAllocAslRequest(a6)
- move.l d0,MyScreenReq(a5)
- bne.s ScreenReqOK
- moveq #24,d7
- bra.s ScreenReqEnde
- ScreenReqOK
- move.l d0,a0
- lea ScreenASLTags(pc),a1
- lea TitleReq(pc),a2
- move.l a2,4(a1)
- jsr _LVOAslRequest(a6)
- tst.l d0
- beq.s ScreenFreeReq
- move.l MyScreenReq(a5),a2
- move.l sm_DisplayID(a2),d6
- lea EndeReqTxt(a5),a1
- lea EndeReqVor(pc),a0
- CopyTxtLoop
- move.b (a0)+,(a1)+
- cmp.b #10,-1(a0)
- bne.s CopyTxtLoop
- move.l #' ',(a1)+
- move.l UTILBase(a5),a6
- bsr.s LongHex2Dez
- move.l WindowHandle(a5),a0
- lea EndeReq(pc),a1
- lea EndeReqTi(pc),a2
- move.l a2,8(a1)
- lea EndeReqTxt(a5),a2
- move.l a2,12(a1)
- lea EndeReqGad(pc),a2
- move.l a2,16(a1)
- suba.l a2,a2
- suba.l a3,a3
- move.l INTUIBase(a5),a6
- jsr _LVOEasyRequestArgs(a6)
- ScreenFreeReq
- move.l ASLBase(a5),a6
- move.l MyScreenReq(a5),a0
- jsr _LVOFreeAslRequest(a6)
- ScreenReqEnde
- rts
- ;;
- ** LongHex2Dez
- *################
- * d6=HexZahl
- * a1=Buffer für DezZahl in Ascii
- * a6=UtilityBase
- *################
- * d0=zwischenspeicher von d6
- * d1=TeilerZahl
- * d2=Zählschleife
- * d3=Führende Null Status
- * a0=Teileraddresse
- LongHex2Dez
- moveq #0,d3
- lea DiviFkt(pc),a0
- moveq #10-1,d2
- move.l d6,d0
- HexZahlloop
- move.l (a0)+,d1
- jsr _LVOUDivMod32(a6)
- tst.w d0
- bne.s keineNull
- tst.b d3
- beq.s naechsteZahl
- keineNull
- add.b #'0',d0
- move.b d0,(a1)+
- moveq #1,d3
- naechsteZahl
- move.l d1,d0
- dbra d2,HexZahlloop
- rts
- ;;
- ** OeffneFenster
- OeffneFenster
- move.l INTUIBase(a5),a6
- lea Fenster_Tags(pc),a1
- lea ScreenTitle(pc),a0
- move.l a0,4(a1)
- move.l ScreenHandle(a5),12(a1)
- suba.l a0,a0
- jsr _LVOOpenWindowTagList(a6)
- move.l d0,WindowHandle(a5)
- bne.s WindowOK
- moveq #23,d7
- WindowOK
- rts
- FensterSchliesse
- move.l INTUIBase(a5),a6
- move.l WindowHandle(a5),a0
- jsr _LVOCloseWindow(a6)
- rts
- ;;
- ** PubScreenHolen
- PubScreenHolen
- move.l INTUIBase(a5),a6
- suba.l a0,a0
- jsr _LVOLockPubScreen(a6)
- move.l d0,ScreenHandle(a5)
- bne.s PubScreenOK
- moveq #25,d7
- PubScreenOK
- rts
- PubScreenAbgeben
- move.l INTUIBase(a5),a6
- suba.l a0,a0
- move.l ScreenHandle(a5),a1
- jsr _LVOUnlockPubScreen(a6)
- rts
- ;;
- ** Library Öffnen + Schliessen
- LibOeffne
- move.l a5,a4
- lea intname(pc),a1
- bsr.s OeffneLib
- lea gfxname(pc),a1
- bsr.s OeffneLib
- lea aslname(pc),a1
- bsr.s OeffneLib
- lea utilname(pc),a1
- bsr.s OeffneLib
- rts
- OeffneLib
- moveq #37,d0
- jsr _LVOOpenLibrary(a6)
- move.l d0,(a4)+
- beq.s LibError
- rts
- LibError
- moveq #22,d7 ;22 = konnte Library nicht öffnen
- rts
- LibSchliesse
- move.l 4.w,a6
- moveq #4-1,d2
- lea MyScreenReq(a5),a4
- SchliesseLib
- move.l -(a4),a1
- cmp.l #0,a1
- beq.s notOpened
- jsr _LVOCloseLibrary(a6)
- notOpened
- dbra d2,SchliesseLib
- rts
- ;;
- ** LONG Daten
- Fenster_Tags
- dc.l WA_ScreenTitle,0
- dc.l WA_PubScreen,0
- dc.l WA_Top,100
- dc.l WA_Left,200
- dc.l WA_Width,200
- dc.l WA_Height,125
- dc.l WA_Flags,WFLG_SMART_REFRESH!WFLG_BACKDROP!WFLG_BORDERLESS
- dc.l TAG_DONE
- ScreenASLTags
- dc.l ASLSM_TitleText,0
- dc.l TAG_DONE
- EndeReq
- dc.l EasyStruct_SIZEOF
- dc.l 0,0,0,0
- DiviFkt
- dc.l 1000000000,100000000,10000000,1000000,100000,10000,1000,100,10,1
- ;;
- ** BYTE Daten
- intname INTUITIONNAME
- gfxname GRAFNAME
- aslname ASLNAME
- utilname UTILITYNAME
- EndeReqVor dc.b 'The MonitorID is:',10
- EndeReqTi dc.b 'MonitorID',0
- EndeReqGad dc.b 'Super|Oh,no!',0
- TitleReq dc.b 'BangerMonitorID',0
- dc.b '$VER: '
- ScreenTitle dc.b 'BangerMonitorID 1.3 (20-Dec-95) © by Andre´ Trettin',0
- ;;
-